Overview
Context
Changes
Modified buildsys.mk.in
from [3204adcbc4]
to [be3d55644e].
︙ | | |
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
+
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+
|
depend: pre-depend ${SRCS}
regen=0; \
deps=""; \
test -f .deps || regen=1; \
for i in ${SRCS}; do \
case $$i in \
*.c) \
test $$i -nt .deps && regen=1; \
deps="$$deps $${i%.c}.dep"; \
*.o) \
;; \
*.cc) \
test $$i -nt .deps && regen=1; \
deps="$${deps%.o}.dep $$i"; \
deps="$$deps $${i%.cc}.dep"; \
;; \
*.cxx) \
test $$i -nt .deps && regen=1; \
deps="$$deps $${i%.cxx}.dep"; \
;; \
*.m) \
test $$i -nt .deps && regen=1; \
deps="$$deps $${i%.m}.dep"; \
;; \
esac; \
done; \
if test x"$$regen" = x"1" -a x"$$deps" != "x"; then \
${DEPEND_STATUS}; \
rm -f .deps; \
if ${MAKE} ${MFLAGS} $$deps; then \
|
︙ | | |
Modified src/Makefile
from [4590acbe8d]
to [3c78222fcb].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
+
-
+
+
|
LIB = ${LIB_PREFIX}objfw${LIB_SUFFIX}
LIB_MAJOR = 1
LIB_MINOR = 0
SRCS = OFConstString.m \
OFConstWideString.m \
OFException.m \
OFList.m \
OFListObject.m \
OFObject.m \
OFString.m \
OFWideString.m
OBJCFLAGS += -fPIC -DPIC -fno-nil-recivers -fconstant-string-class=OFConstString
OBJCFLAGS += -fPIC -DPIC -fno-nil-recivers -fconstant-string-class=OFConstString -fobjc-exceptions
INCLUDES = OFConstString.h \
OFConstWideString.h \
OFException.h \
OFList.h \
OFListObject.h \
OFObject.h \
OFString.h \
OFWideString.h
include ../buildsys.mk
LD = ${OBJC}
LIBS += -lobjc
|
Added src/OFException.h version [aab3ba4a15].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#define __NO_OFEXCEPTION
#import "OFObject.h"
@interface OFException: OFObject
@end
|
| | | | | | | | | | | | | | |
Added src/OFException.m version [6e35154e42].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import "OFException.h"
@implementation OFException
@end
|
| | | | | | | | | | | | | |
Modified src/OFObject.h
from [b47bfb1d54]
to [55682be82c].
︙ | | |
25
26
27
28
29
30
31
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
+
+
+
+
+
+
+
+
+
+
+
|
- init;
- (void*)getMem: (size_t)size;
- (void*)resizeMem: (void*)ptr
toSize: (size_t)size;
- (void)freeMem: (void*)ptr;
- free;
@end
#ifndef __NO_OFEXCEPTION
#import "OFException.h"
@interface OFMemNotPartOfObjException: OFException
+ new: (void*)p
fromObject: (id)obj;
- init: (void*)p
fromObject: (id)obj;
@end
#endif
|
Modified src/OFObject.m
from [b460fe3dcf]
to [9572084d4f].
︙ | | |
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
-
-
-
+
-
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
return NULL;
iter->ptr = ptr;
return ptr;
}
}
fprintf(stderr, "WARNING: Memory at %p was not allocated as part of "
"object %s!\n-> Memory was not resized!\n", ptr, [self name]);
@throw [OFMemNotPartOfObjException new: ptr fromObject: self];
return NULL;
}
- (void)freeMem: (void*)ptr;
{
struct __ofobject_allocated_mem *iter;
for (iter = __mem_pool; iter != NULL; iter = iter->prev) {
if (iter->ptr == ptr) {
if (iter->prev != NULL)
if (iter->prev != NULL)
iter->prev->next = iter->next;
if (iter->next != NULL)
iter->next->prev = iter->prev;
if (__mem_pool == iter)
__mem_pool = NULL;
free(iter);
free(ptr);
return;
}
}
fprintf(stderr, "WARNING: Memory at %p was not allocated as part of "
@throw [OFMemNotPartOfObjException new: ptr fromObject: self];
"object %s!\n-> Memory was not free'd!\n", ptr, [self name]);
}
- free
{
struct __ofobject_allocated_mem *iter, *iter2;
for (iter = __mem_pool; iter != NULL; iter = iter2) {
iter2 = iter->prev;
free(iter->ptr);
free(iter);
}
return [super free];
}
@end
@implementation OFMemNotPartOfObjException
+ new: (void*)ptr fromObject: (id)obj
{
return [[OFMemNotPartOfObjException alloc] init: ptr
fromObject: obj];
}
- init: (void*)ptr fromObject: (id)obj
{
fprintf(stderr, "ERROR: Memory at %p was not allocated as part of "
"object %s!\n"
"ERROR: -> Not changing memory allocation!\n"
"ERROR: (Hint: It is possible that you tried to free the same "
"memory twice!)\n", ptr, [obj name]);
return [super init];
}
@end
|
Modified tests/Makefile
from [40930cdf32]
to [5187c45877].
1
2
3
|
1
2
3
|
-
+
|
SUBDIRS = OFString OFList OFWideString
SUBDIRS = OFObject OFString OFList OFWideString
include ../buildsys.mk
|
Added tests/OFObject/Makefile version [cea45375f0].
|
1
2
3
4
5
6
7
|
+
+
+
+
+
+
+
|
PROG_NOINST = ofobject
SRCS = OFObject.m
include ../../buildsys.mk
CPPFLAGS += -I../../src
LIBS += -lobjc -L../../src -lobjfw
|
| | | | | |
Added tests/OFObject/OFObject.m version [2c9d4130c6].