Index: docs/src/refman/memory.txt
===================================================================
--- docs/src/refman/memory.txt	(revision 14483)
+++ docs/src/refman/memory.txt	(working copy)
@@ -94,5 +94,21 @@
 
 If the pointer is NULL, the default behaviour will be restored.
 
-See also: [ALLEGRO_MEMORY_INTERFACE]
+See also: [ALLEGRO_MEMORY_INTERFACE], [al_get_memory_interface],
+[al_get_default_memory_interface]
 
+## API: al_get_memory_interface
+
+Retrieve the current memory management interface, as set by a previous call to 
+[al_set_memory_interface]. 
+
+See also: [ALLEGRO_MEMORY_INTERFACE], [al_set_memory_interface],
+[al_get_default_memory_interface]
+
+## API: al_get_default_memory_interface
+
+Retrieve the default memory interface used when [al_set_interface] is called 
+with a NULL parameter. 
+
+See also: [ALLEGRO_MEMORY_INTERFACE], [al_set_memory_interface],
+[al_get_memory_interface]
Index: include/allegro5/memory.h
===================================================================
--- include/allegro5/memory.h	(revision 14483)
+++ include/allegro5/memory.h	(working copy)
@@ -33,6 +33,8 @@
 };
 
 AL_FUNC(void, al_set_memory_interface, (ALLEGRO_MEMORY_INTERFACE *iface));
+AL_FUNC(ALLEGRO_MEMORY_INTERFACE*, al_get_memory_interface, (void));
+AL_FUNC(ALLEGRO_MEMORY_INTERFACE*, al_get_default_memory_interface, (void));
 
 
 /* Function: al_malloc
Index: src/memory.c
===================================================================
--- src/memory.c	(revision 14483)
+++ src/memory.c	(working copy)
@@ -22,8 +22,35 @@
 /* globals */
 static ALLEGRO_MEMORY_INTERFACE *mem = NULL;
 
+static void* _al_default_malloc(size_t n, int line, const char *file, const char *func)
+{
+    return malloc(n);
+}
 
+static void _al_default_free(void *ptr, int line, const char *file, const char *func)
+{
+    free(ptr);
+}
 
+static void* _al_default_realloc(void *ptr, size_t n, int line, const char *file, const char *func)
+{
+    return realloc(ptr, n);
+}
+
+static void* _al_default_calloc(size_t count, size_t n, int line, const char *file, const char *func)
+{
+    return calloc(count, n);
+}
+
+static ALLEGRO_MEMORY_INTERFACE _default_mem = {
+   _al_default_malloc, 
+   _al_default_free,
+   _al_default_realloc,
+   _al_default_calloc
+};
+
+
+
 /* Function: al_set_memory_interface
  */
 void al_set_memory_interface(ALLEGRO_MEMORY_INTERFACE *memory_interface)
@@ -31,8 +58,20 @@
    mem = memory_interface;
 }
 
+ALLEGRO_MEMORY_INTERFACE* al_get_memory_interface()
+{
+    if(mem)
+        return mem;
+    return &_default_mem;
+}
 
+ALLEGRO_MEMORY_INTERFACE* al_get_default_memory_interface()
+{
+    return &_default_mem;
+}
 
+
+
 /* Function: al_malloc_with_context
  */
 void *al_malloc_with_context(size_t n,
