16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/**
* The OFObject class is the base class for all other classes inside ObjFW.
*/
@interface OFObject: Object
{
void **__memchunks;
size_t __memchunks_size;
}
/**
* Initialize the already allocated object.
* Also sets up the memory pool for the object.
*
* \return An initialized object
*/
- init;
/**
* Adds a pointer to the memory pool.
* This is useful to add memory allocated by functions such as asprintf to the
* pool so it gets freed automatically when the object is freed.
*
* \param ptr A pointer to add to the memory pool
*/
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/**
* The OFObject class is the base class for all other classes inside ObjFW.
*/
@interface OFObject: Object
{
void **__memchunks;
size_t __memchunks_size;
size_t __retain_count;
}
/**
* Initialize the already allocated object.
* Also sets up the memory pool for the object.
*
* \return An initialized object
*/
- init;
/**
* Increases the retain count.
*/
- retain;
/**
* Decreases the retain cound and frees the object if it reaches 0.
*/
- release;
/**
* Adds the object to the autorelease pool that is on top of the thread's stack.
*/
- autorelease;
/**
* Adds a pointer to the memory pool.
* This is useful to add memory allocated by functions such as asprintf to the
* pool so it gets freed automatically when the object is freed.
*
* \param ptr A pointer to add to the memory pool
*/
|