Skip to content

Commit ead54c1

Browse files
committed
deprecate the ulong wrapper functions in favor of size_t (UIntPtr)
1 parent 965e6d9 commit ead54c1

File tree

10 files changed

+145
-79
lines changed

10 files changed

+145
-79
lines changed

RocksDbSharp/BlockBasedTableOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public BlockBasedTableOptions()
3131

3232
public BlockBasedTableOptions SetBlockSize(ulong blockSize)
3333
{
34-
Native.Instance.rocksdb_block_based_options_set_block_size(Handle, blockSize);
34+
Native.Instance.rocksdb_block_based_options_set_block_size(Handle, (UIntPtr)blockSize);
3535
return this;
3636
}
3737

RocksDbSharp/ColumnFamilyOptions.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public ColumnFamilyOptions SetCompactionFilterFactory(IntPtr compactionFilterFac
142142
//// </summary>
143143
public ColumnFamilyOptions SetCompactionReadaheadSize(ulong size)
144144
{
145-
Native.Instance.rocksdb_options_compaction_readahead_size(Handle, size);
145+
Native.Instance.rocksdb_options_compaction_readahead_size(Handle, (UIntPtr)size);
146146
return this;
147147
}
148148

@@ -423,7 +423,7 @@ public ColumnFamilyOptions SetInfoLogLevel(int value)
423423
/// </summary>
424424
public ColumnFamilyOptions SetWriteBufferSize(ulong value)
425425
{
426-
Native.Instance.rocksdb_options_set_write_buffer_size(Handle, value);
426+
Native.Instance.rocksdb_options_set_write_buffer_size(Handle, (UIntPtr)value);
427427
return this;
428428
}
429429

@@ -676,7 +676,7 @@ public ColumnFamilyOptions SetMaxBytesForLevelMultiplier(double value)
676676
/// </summary>
677677
public ColumnFamilyOptions SetMaxBytesForLevelMultiplierAdditional(int[] levelValues, ulong numLevels)
678678
{
679-
Native.Instance.rocksdb_options_set_max_bytes_for_level_multiplier_additional(Handle, levelValues, numLevels);
679+
Native.Instance.rocksdb_options_set_max_bytes_for_level_multiplier_additional(Handle, levelValues, (UIntPtr)numLevels);
680680
return this;
681681
}
682682

@@ -776,7 +776,7 @@ public ColumnFamilyOptions SetHardRateLimit(double value)
776776
/// </summary>
777777
public ColumnFamilyOptions SetSoftPendingCompactionBytesLimit(ulong value)
778778
{
779-
Native.Instance.rocksdb_options_set_soft_pending_compaction_bytes_limit(Handle, value);
779+
Native.Instance.rocksdb_options_set_soft_pending_compaction_bytes_limit(Handle, (UIntPtr)value);
780780
return this;
781781
}
782782

@@ -788,7 +788,7 @@ public ColumnFamilyOptions SetSoftPendingCompactionBytesLimit(ulong value)
788788
/// </summary>
789789
public ColumnFamilyOptions SetHardPendingCompactionBytesLimit(ulong value)
790790
{
791-
Native.Instance.rocksdb_options_set_hard_pending_compaction_bytes_limit(Handle, value);
791+
Native.Instance.rocksdb_options_set_hard_pending_compaction_bytes_limit(Handle, (UIntPtr)value);
792792
return this;
793793
}
794794

@@ -819,7 +819,7 @@ public ColumnFamilyOptions SetRateLimitDelayMaxMilliseconds(uint value)
819819
/// </summary>
820820
public ColumnFamilyOptions SetArenaBlockSize(ulong value)
821821
{
822-
Native.Instance.rocksdb_options_set_arena_block_size(Handle, value);
822+
Native.Instance.rocksdb_options_set_arena_block_size(Handle, (UIntPtr)value);
823823
return this;
824824
}
825825

@@ -910,19 +910,19 @@ public ColumnFamilyOptions SetMaxCompactionBytes(ulong bytes)
910910

911911
public ColumnFamilyOptions SetHashSkipListRep(ulong p1, int p2, int p3)
912912
{
913-
Native.Instance.rocksdb_options_set_hash_skip_list_rep(Handle, p1, p2, p3);
913+
Native.Instance.rocksdb_options_set_hash_skip_list_rep(Handle, (UIntPtr)p1, p2, p3);
914914
return this;
915915
}
916916

917917
public ColumnFamilyOptions SetHashLinkListRep(ulong value)
918918
{
919-
Native.Instance.rocksdb_options_set_hash_link_list_rep(Handle, value);
919+
Native.Instance.rocksdb_options_set_hash_link_list_rep(Handle, (UIntPtr)value);
920920
return this;
921921
}
922922

923923
public ColumnFamilyOptions SetPlainTableFactory(UInt32 p1, int p2, double p3, ulong p4)
924924
{
925-
Native.Instance.rocksdb_options_set_plain_table_factory(Handle, p1, p2, p3, p4);
925+
Native.Instance.rocksdb_options_set_plain_table_factory(Handle, p1, p2, p3, (UIntPtr)p4);
926926
return this;
927927
}
928928

@@ -970,7 +970,7 @@ public ColumnFamilyOptions SetMinLevelToCompress(int level)
970970
/// </summary>
971971
public ColumnFamilyOptions SetMaxSuccessiveMerges(ulong value)
972972
{
973-
Native.Instance.rocksdb_options_set_max_successive_merges(Handle, value);
973+
Native.Instance.rocksdb_options_set_max_successive_merges(Handle, (UIntPtr)value);
974974
return this;
975975
}
976976

@@ -1015,7 +1015,7 @@ public ColumnFamilyOptions SetInplaceUpdateSupport(bool value)
10151015
/// </summary>
10161016
public ColumnFamilyOptions SetInplaceUpdateNumLocks(ulong value)
10171017
{
1018-
Native.Instance.rocksdb_options_set_inplace_update_num_locks(Handle, value);
1018+
Native.Instance.rocksdb_options_set_inplace_update_num_locks(Handle, (UIntPtr)value);
10191019
return this;
10201020
}
10211021

@@ -1091,7 +1091,7 @@ public ColumnFamilyOptions SetFifoCompactionOptions(IntPtr fifoCompactionOptions
10911091
/// </summary>
10921092
public ColumnFamilyOptions SetMemtableHugePageSize(ulong size)
10931093
{
1094-
Native.Instance.rocksdb_options_set_memtable_huge_page_size(Handle, size);
1094+
Native.Instance.rocksdb_options_set_memtable_huge_page_size(Handle, (UIntPtr)size);
10951095
return this;
10961096
}
10971097

RocksDbSharp/DbOptions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public DbOptions SetMaxBackgroundFlushes(int value)
248248
/// </summary>
249249
public DbOptions SetMaxLogFileSize(ulong value)
250250
{
251-
Native.Instance.rocksdb_options_set_max_log_file_size(Handle, value);
251+
Native.Instance.rocksdb_options_set_max_log_file_size(Handle, (UIntPtr)value);
252252
return this;
253253
}
254254

@@ -260,7 +260,7 @@ public DbOptions SetMaxLogFileSize(ulong value)
260260
/// </summary>
261261
public DbOptions SetLogFileTimeToRoll(ulong value)
262262
{
263-
Native.Instance.rocksdb_options_set_log_file_time_to_roll(Handle, value);
263+
Native.Instance.rocksdb_options_set_log_file_time_to_roll(Handle, (UIntPtr)value);
264264
return this;
265265
}
266266

@@ -270,7 +270,7 @@ public DbOptions SetLogFileTimeToRoll(ulong value)
270270
/// </summary>
271271
public DbOptions SetKeepLogFileNum(ulong value)
272272
{
273-
Native.Instance.rocksdb_options_set_keep_log_file_num(Handle, value);
273+
Native.Instance.rocksdb_options_set_keep_log_file_num(Handle, (UIntPtr)value);
274274
return this;
275275
}
276276

@@ -286,7 +286,7 @@ public DbOptions SetKeepLogFileNum(ulong value)
286286
/// </summary>
287287
public DbOptions SetRecycleLogFileNum(ulong value)
288288
{
289-
Native.Instance.rocksdb_options_set_recycle_log_file_num(Handle, value);
289+
Native.Instance.rocksdb_options_set_recycle_log_file_num(Handle, (UIntPtr)value);
290290
return this;
291291
}
292292

@@ -297,7 +297,7 @@ public DbOptions SetRecycleLogFileNum(ulong value)
297297
/// </summary>
298298
public DbOptions SetMaxManifestFileSize(ulong value)
299299
{
300-
Native.Instance.rocksdb_options_set_max_manifest_file_size(Handle, value);
300+
Native.Instance.rocksdb_options_set_max_manifest_file_size(Handle, (UIntPtr)value);
301301
return this;
302302
}
303303

@@ -406,7 +406,7 @@ public DbOptions SetWALSizeLimitMB(ulong value)
406406
/// </summary>
407407
public DbOptions SetManifestPreallocationSize(ulong value)
408408
{
409-
Native.Instance.rocksdb_options_set_manifest_preallocation_size(Handle, value);
409+
Native.Instance.rocksdb_options_set_manifest_preallocation_size(Handle, (UIntPtr)value);
410410
return this;
411411
}
412412

@@ -504,7 +504,7 @@ public DbOptions SetAdviseRandomOnOpen(bool value)
504504
/// </summary>
505505
public DbOptions SetDbWriteBufferSize(ulong size)
506506
{
507-
Native.Instance.rocksdb_options_set_db_write_buffer_size(Handle, size);
507+
Native.Instance.rocksdb_options_set_db_write_buffer_size(Handle, (UIntPtr)size);
508508
return this;
509509
}
510510

RocksDbSharp/Iterator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public Iterator SeekToLast()
7272

7373
public unsafe Iterator Seek(byte *key, ulong klen)
7474
{
75-
Native.Instance.rocksdb_iter_seek(handle, key, klen);
75+
Native.Instance.rocksdb_iter_seek(handle, key, (UIntPtr)klen);
7676
return this;
7777
}
7878

@@ -83,7 +83,7 @@ public Iterator Seek(byte[] key)
8383

8484
public Iterator Seek(byte[] key, ulong klen)
8585
{
86-
Native.Instance.rocksdb_iter_seek(handle, key, klen);
86+
Native.Instance.rocksdb_iter_seek(handle, key, (UIntPtr)klen);
8787
return this;
8888
}
8989

@@ -95,7 +95,7 @@ public Iterator Seek(string key)
9595

9696
public unsafe Iterator SeekForPrev(byte* key, ulong klen)
9797
{
98-
Native.Instance.rocksdb_iter_seek_for_prev(handle, key, klen);
98+
Native.Instance.rocksdb_iter_seek_for_prev(handle, key, (UIntPtr)klen);
9999
return this;
100100
}
101101

@@ -107,7 +107,7 @@ public Iterator SeekForPrev(byte[] key)
107107

108108
public Iterator SeekForPrev(byte[] key, ulong klen)
109109
{
110-
Native.Instance.rocksdb_iter_seek_for_prev(handle, key, klen);
110+
Native.Instance.rocksdb_iter_seek_for_prev(handle, key, (UIntPtr)klen);
111111
return this;
112112
}
113113

0 commit comments

Comments
 (0)