~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to doc/blender-guardedalloc.txt

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
MEMORY MANAGEMENT IN BLENDER (guardedalloc)
2
 
-------------------------------------------
3
 
 
4
 
NOTE: This file does not cover memutil and smart pointers and rerefence counted
5
 
      garbage collection, which are contained in the memutil module.
6
 
 
7
 
Blender takes care of dynamic memory allocation using a set of own functions
8
 
which are recognizeable through their MEM_ prefix. All memory allocation and
9
 
deallocation in blender is done through these functions.
10
 
 
11
 
The following functions are available through MEM_guardedalloc.h:
12
 
 
13
 
For normal operation:
14
 
---------------------
15
 
 
16
 
void *MEM_[mc]allocN(unsigned int len, char * str);
17
 
 
18
 
- nearest ANSI counterpart: malloc()
19
 
- str must be a static string describing the memory block (used for debugging
20
 
memory management problems)
21
 
- returns a memory block of length len
22
 
- MEM_callocN clears the memory block to 0
23
 
 
24
 
void *MEM_dupallocN(void *vmemh);
25
 
 
26
 
- nearest ANSI counterpart: combination malloc() and memcpy()
27
 
- returns a pointer to a copy of the given memory area
28
 
 
29
 
short MEM_freeN(void *vmemh);
30
 
 
31
 
- nearest ANSI counterpart: free()
32
 
- frees the memory area given by the pointer
33
 
- returns 0 on success and !=0 on error
34
 
 
35
 
int MEM_allocN_len(void *vmemh);
36
 
 
37
 
- nearest ANSI counterpart: none known
38
 
- returns the length of the given memory area
39
 
 
40
 
For debugging:
41
 
--------------
42
 
 
43
 
void MEM_set_error_stream(FILE*);
44
 
 
45
 
- this sets the file the memory manager should use to output debugging messages
46
 
- if the parameter is NULL the messages are suppressed
47
 
- default is that messages are suppressed
48
 
 
49
 
void MEM_printmemlist(void);
50
 
 
51
 
- if err_stream is set by MEM_set_error_stream() this function dumps a list of all
52
 
currently allocated memory blocks with length and name to the stream
53
 
 
54
 
int MEM_check_memory_integrity(void);
55
 
 
56
 
- this function tests if the internal structures of the memory manager are intact
57
 
- returns 0 on success and !=0 on error