summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/mem.h
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/src/mem.h')
-rw-r--r--xc/extras/Mesa/src/mem.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/xc/extras/Mesa/src/mem.h b/xc/extras/Mesa/src/mem.h
index 794aa13ef..e9b1f3136 100644
--- a/xc/extras/Mesa/src/mem.h
+++ b/xc/extras/Mesa/src/mem.h
@@ -22,7 +22,7 @@
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+/* $XFree86: xc/extras/Mesa/src/mem.h,v 1.5 2000/09/26 15:56:32 tsi Exp $ */
#ifndef MEM_H
#define MEM_H
@@ -38,6 +38,10 @@ extern void *_mesa_malloc(size_t bytes);
extern void *_mesa_calloc(size_t bytes);
extern void _mesa_free(void *ptr);
+extern void *_mesa_align_malloc(size_t bytes, unsigned long alignment);
+extern void *_mesa_align_calloc(size_t bytes, unsigned long alignment);
+extern void _mesa_align_free(void *ptr);
+
#ifdef DEBUG
@@ -59,6 +63,13 @@ extern void _mesa_free(void *ptr);
#endif
+/* call Mesa N-byte aligned memory functions */
+#define ALIGN_MALLOC(BYTES, N) (void *) _mesa_align_malloc(BYTES, N)
+#define ALIGN_CALLOC(BYTES, N) (void *) _mesa_align_calloc(BYTES, N)
+#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N)
+#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N)
+#define ALIGN_FREE(PTR) _mesa_align_free(PTR)
+
/* Memory copy: */
#ifdef SUNOS4