chore: get rid of object.c and robj* in cc code (#2610)

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-02-18 16:52:23 +02:00 committed by GitHub
parent 417ca952d6
commit fa75360227
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 94 additions and 1962 deletions

View file

@ -40,6 +40,10 @@
* This should be the size of the buffer given to ld2string */
#define MAX_LONG_DOUBLE_CHARS 5*1024
/* Error codes */
#define C_OK 0
#define C_ERR -1
/* long double to string conversion options */
typedef enum {
LD_STR_AUTO, /* %.17Lg */
@ -63,9 +67,6 @@ int string2ld(const char *s, size_t slen, long double *dp);
int d2string(char *buf, size_t len, double value);
int ld2string(char *buf, size_t len, long double value, ld2string_mode mode);
long getTimeZone(void);
int pathIsBaseName(char *path);
#define LOG_MAX_LEN 1024 /* Default maximum length of syslog messages.*/
/* Log levels */
@ -83,16 +84,11 @@ int pathIsBaseName(char *path);
void serverLog(int level, const char *fmt, ...);
void _serverPanic(const char *file, int line, const char *msg, ...);
void _serverAssert(const char *estr, const char *file, int line);
void serverLogHexDump(int level, char *descr, void *value, size_t len);
#define serverPanic(...) _serverPanic(__FILE__,__LINE__,__VA_ARGS__),_exit(1)
#define serverAssert(_e) ((_e)?(void)0 : (_serverAssert(#_e,__FILE__,__LINE__),_exit(1)))
extern int verbosity;
typedef long long mstime_t; /* millisecond time type. */
unsigned int LRU_CLOCK(void);
void debugDelay(int usec);
long long ustime(void);
/* Return the current time in minutes, just taking the least significant
@ -122,16 +118,5 @@ static inline mstime_t mstime(void) {
return ustime()/1000;
}
/* Return the LRU clock, based on the clock resolution. This is a time
* in a reduced-bits format that can be used to set and check the
* object->lru field of redisObject structures. */
static inline unsigned int getLRUClock(void) {
int64_t t = time(NULL);
return t & LRU_CLOCK_MAX;
}
#ifdef REDIS_TEST
int utilTest(int argc, char **argv, int accurate);
#endif
#endif